package org.threadExecutroService;

import java.util.concurrent.Executor;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.ThreadPoolExecutor;

public class Demo {
    public static void main(String[] args) {

//        创建线程池,池子里面最多5个线程
        ExecutorService executorService= Executors.newFixedThreadPool(5);
        executorService.submit(new CallableDemo());
        executorService.submit(new CallableDemo());
        executorService.submit(new CallableDemo());
        executorService.submit(new CallableDemo());
        executorService.submit(new CallableDemo());
        executorService.submit(new CallableDemo());
        executorService.submit(new CallableDemo());
        executorService.submit(new CallableDemo());
        executorService.submit(new CallableDemo());
    }
}
